package com.city.service.party.impl;

import com.city.domain.party.ReportPerson;
import com.city.repository.party.ReportPersonRepository;
import com.city.service.party.ReportPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportPersonServiceImpl implements ReportPersonService{

    @Autowired
    private ReportPersonRepository reportPersonRepository;
    @Override
    public List<ReportPerson> findByPage(Integer page, Integer limit) {
        return reportPersonRepository.findAllByPage((page-1)*limit,limit);
    }

    @Override
    public long count() {
        return reportPersonRepository.count();
    }

    @Override
    public ReportPerson findById(int id) {
        return reportPersonRepository.findOne(id);
    }

    @Override
    public void delete(int id) {
        reportPersonRepository.delete(id);
    }
}
